<admintpl file="header" />
</head>
<body>
    <div class="wrap js-check-wrap">
        <ul class="nav nav-tabs">
            <li class="active"><a href="{:U('Device/index')}">设备列表</a></li>
     		<li><a href="{:U('Device/inputcsv')}">导入信息</a></li>
            <li><a href="{:U('Device/add')}">添加设备</a></li>
        </ul>
        <form class="well form-search js-ajax-form" method="post" action="{:U('Device/index')}">
            设备类型：
            <select name="dtype" style="width: 150px;">
                <foreach name="dtype" item="vo">
                    <option <if condition="(I('param.dtype') eq $vo['id'])" >selected</if> value="{$vo.id}">{$vo.name}</option>
                </foreach>
            </select>
            查询类型：
            <select name="search" style="width: 150px;">
                <foreach name="search" item="vo">
                    <option <if condition="(I('param.search') eq $vo['id'])" >selected</if> value="{$vo.id}">{$vo.name}</option>
                </foreach>
            </select>
            查询内容：
            <input type="text" name="keyword" style="width: 150px;" value="{:I('param.keyword')}" placeholder="请输入查询内容...">

            <input type="submit" class="btn btn-primary" value="搜索" />
            <if condition="$count" >共查询到 {$count} 条数据</if>
<br/>
            设备状态：
            <select name="status" style="width: 150px;">
                <foreach name="bstatus" item="vo">
                    <option <if condition="(I('param.status') eq $vo['id'])" >selected</if> value="{$vo.id}">{$vo.name}</option>
                </foreach>
            </select>
            更新时间：
            <input type="text" name="start_time" class="js-datetime" value="{:I('param.start_time')}" style="width: 173px;" autocomplete="off"> ~
            <input type="text" name="end_time" class="js-datetime"  value="{:I('param.end_time')}" style="width: 172px;" autocomplete="off">

        	<button class="btn btn-primary js-ajax-submit" type="submit" data-action="{:U('Device/outcsv')}">查询导出</button>

        </form>
            <div class="pagination">{$page}</div>
            <table class="table table-hover table-bordered">
                <thead>
                    <tr>
                    	<th width="40">ID</th>
                        <th>店铺名称/店铺地址</th>
                        <th>设备ID/条形码</th>
                        <th>major/minor</th>
                        <th>设备类型/设备状态</th>
                        <th width="120">更新时间/激活时间</th>
                        <th width="30">操作</th>
                    </tr>
                </thead>
                <foreach name="devices" item="vo">
                    <tr>
                        <td>{$vo.id}<br>{$vo['locking']==1?"已锁定":"未锁定"}</td>
                        <td>
                        	<foreach name="stores" item="st">
								<if condition="$st['store_id'] eq $vo['store_id']" >
									<a href="{:U('Store/edit', array('id'=>$st['id']))}">{$st.title}({$st.title_branch})</a>
									 - {$stype[$st['stype']]['name']}
									<br>{$st.address}
								</if>
                           </foreach>
                        </td>
                        <td>{$vo.devid}<br>{$vo.barcode}</td>
                        <td>{$vo.major}<br>{$vo.minor}</td>
                        <td>{$vo.remark}<br>{$bstatus[$vo['status']]['name']}</td>
                        <td>{$vo.updatetime}<br>{$vo.livetime}</td>
                        <td>
							<a href="{:U('Device/edit', array('id'=>$vo['id']))}">{:L('EDIT')}</a>
						</td>
                    </tr>
                </foreach>
                <thead>
                    <tr>
                    	<th width="40">ID</th>
                        <th>店铺名称/店铺地址</th>
                        <th>设备ID/条形码</th>
                        <th>major/minor</th>
                        <th>更新时间/激活时间</th>
                        <th>设备类型/设备状态</th>·
                        <th width="30">操作</th>
                    </tr>
                </thead>
            </table>
            <div class="pagination">{$page}</div>
    </div>
    <script src="__PUBLIC__/js/common.js"></script>
</body>
</html>